local ads__guanyue = fk.CreateSkill({
  name = "ads__guanyue",
})

ads__guanyue:addEffect(fk.EventPhaseStart, {
  anim_type = "control",
  can_trigger = function(self, event, target, player, data)
    return target == player and player:hasSkill(ads__guanyue.name) and player.phase == Player.Finish
  end,
  on_use = function(self, event, target, player, data)
    local room = player.room
    local count = math.max(5, #room.alive_players)
    local cards = room:getNCards(count, "bottom") 
    room:askToGuanxing(player, {
      cards = cards,
      skill_name = ads__guanyue.name,
      reverse = true, 
    })
  end,
})


Fk:loadTranslationTable{
  ["$ads__guanyue1"] = "观今夜天象，知天下大事。",
  ["$ads__guanyue2"] = "知天易，逆天难。",
  ["ads__guanyue"] = "观月",
  [":ads__guanyue"] = "结束阶段开始时，你可以观看牌堆底的X张牌，然后将任意数量的牌置于牌堆底，将其余的牌置于牌堆顶。（X为存活角色数且至少为5）",
}

ads__guanyue:addAI({
  think_skill_invoke = Util.TrueFunc,
})

return ads__guanyue
